*******************************************************************************
* Shell
*
* (C)  Copyright Apple Computer, Inc. 1988
* All rights reserved.
*
* by Jim Mensch and Keith Rollin
* June 30, 1988
*
* This program shows the bare minimum that an Application should do in order
* to work correctly on the IIgs in the desktop environment. It also shows how
* to start up all the tools necessary to run and gives a sample event loop.
*
* How to use: Use this program as a template whenever you start out to write
* a desktop program. It is broken up into simple modules, that can be added
* to, modified, or removed.
*
* Demo Index:
*               Tool Startup
*               Simple Event Loop
*               Alert Box
*               Simple menu dispatch
*               Simple menu creation
*
*
* Files: System macros and equates.
*
*
* Modification History:
*
* Version 1.0   Mensch & Rollin
*
*      June 30, 1988
*
*      First Release
*
*******************************************************************************

**********************************************************************
*                                                                    *
*             Apple IIGS Source Code Sampler, Volume I               *
*                                                                    *
*             Copyright (c) Apple Computer, Inc. 1988                *
*                       All Rights Reserved                          *
*                                                                    *
*            Written by Apple II Developer Tech Support              *
*                                                                    *
*                                                                    *
*                                                                    *
*  ----------------------------------------------------------------  *
*                                                                    *
*     This program and its derivatives are licensed only for         *
*     use on Apple computers.                                        *
*                                                                    *
*     Works based on this program must contain and                   *
*     conspicuously display this notice.                             *
*                                                                    *
*     This software is provided for your evaluation and to           *
*     assist you in developing software for the Apple IIGS           *
*     computer.                                                      *
*                                                                    *
*     DISCLAIMER OF WARRANTY                                         *
*                                                                    *
*     THE SOFTWARE IS PROVIDED "AS IS" WITHOUT                       *
*     WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,               *
*     WITH RESPECT TO ITS MERCHANTABILITY OR ITS FITNESS             *
*     FOR ANY PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO             *
*     THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH            *
*     YOU.  SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU (AND            *
*     NOT APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE)               *
*     ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING,             *
*     REPAIR OR CORRECTION.                                          *
*                                                                    *
*     Apple does not warrant that the functions                      *
*     contained in the Software will meet your requirements          *
*     or that the operation of the Software will be                  *
*     uninterrupted or error free or that defects in the             *
*     Software will be corrected.                                    *
*                                                                    *
*     SOME STATES DO NOT ALLOW THE EXCLUSION                         *
*     OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY              *
*     NOT APPLY TO YOU.  THIS WARRANTY GIVES YOU SPECIFIC            *
*     LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS                *
*     WHICH VARY FROM STATE TO STATE.                                *
*                                                                    *
*                                                                    *
**********************************************************************


                mcopy shell.macros
                copy 2/ainclude/E16.Quickdraw
                copy 2/ainclude/E16.Memory
                copy 2/ainclude/E16.Window
                copy 2/ainclude/E16.Dialog
                copy 2/ainclude/E16.Event

*******************************************************************************
*
*    Equates used in this program.
*
*******************************************************************************
DPHandle        gequ 0           ; Handle to Tool Direct Page area
DPPointer       gequ DPHandle+4  ; Pointer to Tool Direct Page area
deref           gequ DPPointer+4 ; Temporary Handle dereference area

ScreenMode      gequ $80
ScreenWidth     gequ 640


                EJECT
*******************************************************************************
*
Main            start
*
* Description:  This is the main routine. It calls routines to Initialize
*               the tools, initialize application specific data, run the
*               main EventLoop, close the application, and close the tools.
*               Then it calls the ProDOS Quit command.
*
*
* Inputs:       NONE
*
* Outputs:      NONE
*
* External Refs:
*               Import InitTools
*               Import InitApp
*               Import EventLoop
*               Import CloseApp
*               Import CloseTools
*               Import QuitParms
*
* Entry Points: NONE
*
*******************************************************************************
                using globals
                jsr InitTools
                jsr InitApp

                _ShowCursor

                jsr EventLoop
                
                jsr CloseApp
                jsr CloseTools

                _Quit QuitParms

                end

                EJECT
*******************************************************************************
*
Globals         data
*
* Description:  Holder of all of our data.
*
*
* Inputs:       N/A
*
* Outputs:      N/A
*
* External Refs:                NONE
*
* Entry Points:
*               Export QuitParms                ; used by Main
*
*******************************************************************************
*
* Standard global data
*
*******************************************************************************

TitleString     str 'Apple IIgs Shell Application'
AutString       str 'By Mensch and Rollin Apple DTS (c)1988 Apple Computer'
VersString      str 'Version: 1.0'

MenuHeight      ds 2            ; Stored height of menu bar
MyID            ds 2            ; Application ID

QuitFlag        ds 2
QuitParms       dc i4'0'        ; Pathname of next app
                dc i2'$00'      ; flags

EventRecord     ANOP
EventWhat       ds 2
EventMessage    ds 4
EventWhen       ds 4
EventWhere      ds 4
EventModifiers  ds 2
TaskData        ds 4
TaskMask        dc i4'$0000FFFF'                ; Handle all events possible

                EJECT
*******************************************************************************
*
* Application specific global data
*
*******************************************************************************

; This is a list of pointers to the text that is used to create our menus. It
; is used by InitApp to find all of the menu templates and use them to create
; our menubar. This loop loads MenuPtrLen-4 into an index, gets the
; corresponding menu template pointer in this table, and uses that in a
; NewMenu call. It then decrements the index by 4, and repeats the procees
; until the index is negative.

MenuPtr         dc i4'AppMenu'
                dc i4'FileMenu'
                dc i4'EditMenu'
MenuPtrLen      equ *-MenuPtr


; Menu list: menu items should be numbered consecutivly starting from 250.
; As a convention, use 256 as about and 257 as Quit.

FirstMenuID     equ 250
UndoID          equ 250
CutID           equ 251
CopyID          equ 252
PasteID         equ 253
ClearID         equ 254
CloseID         equ 255
AboutID         equ 256
QuitID          equ 257

AppMenu         dc c'$$@\N1',h'0D'
                dc c'--About Shell Application...\N256V',h'00'
                dc c'.'
FileMenu        dc c'$$  File  \N2',h'00'
                dc c'--Close Document\N255DV',h'00'
                dc c'--Quit\N257*Qq',h'00'
                dc c'.'
EditMenu        dc c'$$  Edit  \N3',h'00'
                dc c'--Undo\N250*ZzVD',h'00'
                dc c'--Cut\N251*XxD',h'00'
                dc c'--Copy\N252*CcD',h'00'
                dc c'--Paste\N253*VvD',h'00'
                dc c'--Clear\N254D',h'00'
                dc c'.'

; Flag telling if the system window is the top window or not. This is set to
; the output of a GetWKind call.
WindType        ds 2
                end

                EJECT
*******************************************************************************
*
InitTools       start
*
* Description:  Load and initialize the tools needed. Errors are detected
*               and FatalError is called if any occur. If there aren't any
*               errors, the list of menu templates is read and the menu-
*               bar is created.
*
*
* Inputs:       NONE
*
* Outputs:      NONE
*
* External Refs:
*               Import FatalError
*
* Entry Points: NONE
*
*******************************************************************************
                using Globals

;
;   Tool Direct page offsets here
;
QDDPage         equ $0000
EMDPage         equ QDDPage+$0300
CtlDPage        equ EMDPage+$0100
MenuDPage       equ CtlDPage+$0100
LEDPage         equ MenuDPage+$0100
ToolDPSize      equ LEDPage+$0100

                phk             ; Save program bank register and
                plb             ; load it as the data bank register

                _TLStartup      ; Start Tool Locator

                pha             ; Space for result
                _MMStartup      ; Start memory manager
                PullWord MyID   ; Save it for later use

                _MTStartup      ; Start up Misc Tools

                _IMStartup      ; Start integer math toolset

                PushLong #ToolTable ; Pointer to Tool table
                _LoadTools      ; Load all RAM based tools
                bcc IT0005      ; Carry clear means no error
                brl FatalError  ; Tools can't be loaded. Fatal error!

IT0005          ANOP

; Get memory for Tool Direct pages

                pha             ; Room for result
                pha
                PushLong #ToolDPSize ; Number of bytes needed
                PushWord MyID   ; ID of this application
                PushWord #AttrLocked+attrFixed+attrPage+attrBank
                PushLong #0     ; Allocate them in bank 0
                _NewHandle
                bcc IT0010      ; Test carry for error
                brl FatalError  ; If no memory we got a fatal error!

IT0010          PullLong DPHandle ; Retrieve handle to our DPage area

                lda [DPHandle]  ; Dereference the handle to get a ptr
                sta DPPointer   ; to our direct page area and save it.

                PushWord DPPointer   ; QuickDraw uses 3 pages of Dpage
                PushWord #ScreenMode ; Used to set all master SCB's
                PushWord #0     ; Zero means use default buf size
                PushWord MyID   ; Application ID for allocating data
                _QDStartup      ; Start QuickDraw, turn on SHR Screen
                bcc IT0015
                brl FatalError  ; If it can't be started then bomb

IT0015          ANOP
                _QDAuxStartup
                
                lda DPPointer   ; Create address for Event Mgr DPage by
                clc             ; loading in the pointer to the start
                adc #EMDPage    ; of DPage and adding Evt Mgr offset.
                pha             ; Now push it on the stack.
                PushWord #20    ; Size of event queue.
                PushWord #0     ; MouseClamp values.
                PushWord #ScreenWidth ; These will clamp mouse to screen
                PushWord #0     ; area only.
                PushWord #200
                PushWord MyID
                _EMStartup      ; Start the event manager
                bcc IT0020
                brl FatalError
IT0020          ANOP
                PushWord MyID   ; Startup the Window Manager
                _WindStartup
                bcc IT0025
                brl FatalError
IT0025          ANOP
                PushWord MyID   ; startup the control manager
                lda DPPointer
                clc
                adc #CtlDPage
                pha
                _CtlStartup
                bcc IT0030
                brl FatalError
IT0030          ANOP

                PushWord MyID   ; menu manager startup
                lda DPPointer
                clc
                adc #MenuDPage
                pha
                _MenuStartUp
                bcc IT0035
                brl FatalError
IT0035          ANOP
                PushWord MyID   ; Line edit Startup
                lda DPPointer
                clc
                adc #LEDPage
                pha
                _LEStartUp
                bcc IT0040
                brl FatalError
IT0040          ANOP
                PushWord MyID   ; Dialog manager startup
                _DialogStartup
                bcc IT0045
                brl FatalError
IT0045          ANOP
                _ScrapStartup   ; No errors possible for this call

                _DeskStartup    ; No error possible for this call

; insert application specific tools here

                PushLong #0     ; refresh the whole desktop
                _RefreshDeskTop

;
; Create the menus I need
;

                ldx #MenuPtrLen-4               ; Get a pointer to the last menu                
loop            phx             ; Save menu table index on the stack
                pha             ; Push on space for the menu handle
                pha             ;   returned by NewMenu
                lda MenuPtr+2,x ; Push on the pointer to the template
                pha             ;   to be used by NewMenu when
                lda MenuPtr,x   ;   creating the menu
                pha
                _NewMenu        ; Create a new menu
                PushWord #0     ; Tell InsertMenu where to put it
                _InsertMenu     ; Insert it.
                plx             ; Get our index back off the stack
                dex             ; Point to the next template pointer
                dex
                dex
                dex
                bpl loop        ; Go back up if not done yet.

                PushWord #1     ; Add NDA's
                _FixAppleMenu

                pha             ; Call FixMenuBar to cause the menu
                _FixMenuBar     ; Compute standard menu sizes
                PullWord MenuHeight             ; and store the menu height for later

                _DrawMenuBar    ; Finally, draw it.

                RTS
                
; Data Block for LoadTools call
ToolTable       dc i2'7'        ; total number of entries in the table          
                dc i2'14,$0100' ; Window Manager
                dc i2'15,$0100' ; Menu Manager
                dc i2'16,$0100' ; Control Manager
                dc i2'18,$0100' ; QD Aux
                dc i2'20,$0100' ; LineEdit tool set
                dc i2'21,$0100' ; Dialog Manager
                dc i2'22,$0100' ; Scrap manager
                
; Some common tools not used in this application. To use these, copy the data
; line to the above table, update the total number of tools in the table
; and then insert the proper startup and shutdown calls
;               dc i2'19,$0100' ; Print Manager
;               dc i2'23,$0100' ; Standard File Operations
;               dc i2'25,$0100' ; Note Synthesizer
;               dc i2'27,$0100' ; Font Manager
;               dc i2'28,$0100' ; List Manager
;               dc i2'32,$0100' ; MIDI Tools

                end

                EJECT
*******************************************************************************
*
FatalError      start
*
* Description:  Routine that is called whenever a tool sends back an error
*               that can not be recovered from. This routine prints the
*               error on the screen, waits for a keypress then quits back
*               to whoever started this application up!
*
*
* Inputs:       A = Error number
*
* Outputs:      NONE (program exits)
*
* External Refs:
*               Import CloseTools
*
* Entry Points: NONE
*
*******************************************************************************
                using Globals

                pha             ; Push the error code
                PushLong #errNumStr             ; Address of storage area
                PushWord #4     ; Length of string
                _Int2Hex

                _GrafOff        ; If QD Started, shut off graphics

                PushLong #ErrStr                ; Write error message to the screen
                _WriteCString

                pha             ; Space for result
                PushWord #0     ; No echo
                _ReadChar       ; Wait for a key to be pressed
                pla             ; Discard the key

                jsr CloseTools  ; Shut down all the tools in case
;                                 any got started up

                _Quit QuitParms ; Quit back to where we came from.
; Quit can not fail, so we can never come back from the quit call.
                
ErrStr          dc c'A fatal error has occured $'
ErrNumStr       dc c'xxxx   press any key to exit',i1'0'

                end

                EJECT
*******************************************************************************
*
CloseTools      start
*
* Description:  Shut down the tools I started.
*
*
* Inputs:       NONE
*
* Outputs:      NONE
*
* External Refs:                NONE
*
* Entry Points: NONE
*
*******************************************************************************
                using Globals

                _DeskShutDown   ; Shut down the tools in the reverse
                _ScrapShutDown  ; order they were started.
                _DialogShutDown
                _LEShutDown
                _MenuShutDown
                _CtlShutDown
                _WindShutDown
                _EMShutDown
                _QDAuxShutDown
                _QDShutDown
                _MTShutDown

                PushLong DPHandle               ; Dispose of all that DP memory
                _DisposeHandle

                PushWord MyID
                _MMShutDown
                _TLShutDown

                rts
                end

                EJECT
*******************************************************************************
*
InitApp         start
*
* Description:  Perform any application specific initialization. For this
*               app, all we do is initialize the quitflag to zero. You 
*               might use this procedure to create windows, initialize vars
*               and allocate memory needed for the entire program.
*
* Inputs:       NONE
*
* Outputs:      NONE
*
* External Refs:                NONE
*
* Entry Points: NONE
*
*******************************************************************************
                using Globals

                stz QuitFlag
                stz WindType
                
                rts
                end



*******************************************************************************
*
CloseApp        start
*
* Description:  Close down things. This disposes of all items and memory
*               that we allocated. Usually undoes what was done in InitApp.
*
*
* Inputs:       NONE
*
* Outputs:      NONE
*
* External Refs:                NONE
*
* Entry Points: NONE
*
*******************************************************************************
                using Globals
                
                rts
                end

                EJECT
*******************************************************************************
*
EventLoop       start
*
* Description:  Main Event Loop. Handle things until user selects Quit.
*
*
* Inputs:       NONE
*
* Outputs:      NONE
*
* External Refs:
*               Import MenuSelect
*               Import ignore
*               Import doUpdate
*               Import testTopWindow
*               Import doSysChange
*               Import InContent
*
* Entry Points: NONE
*
*******************************************************************************
                using Globals

                jsr TestTopWindow

                pha             ; Push on space for TaskMaster result
                PushWord #EveryEvent ; GetNextEvent mask
                PushLong #EventRecord ; Pointer to Event Record
                _TaskMaster
                pla             ; Get TaskMaster result
                
; Now that we have the task type, we first test to see if it was a Null event
; If it was a null event, this program will not handle it. If you want to handle 
; Null events in your application, remove the next line

                cmp #$1D        ; see if we are outside the range of
                bge EventLoop   ; tasks we handle, if so treat as a Null
                asl A           ; Turn it into an index
                tax
                jsr (TaskTable,x)  ; Call appropriate event handler

                lda QuitFlag    ; Quit selected?
                beq EventLoop   ; no - keep looping

                rts             ; yes- leave the program

TaskTable       dc i2'Ignore'   ; 0 Null
                dc i2'Ignore'   ; 1 MouseDown
                dc i2'Ignore'   ; 2 MouseUp
                dc i2'Ignore'   ; 3 KeyDown
                dc i2'Ignore'   ; 4 undefined
                dc i2'Ignore'   ; 5 AutoKey
                dc i2'doUpdate' ; 6 Update
                dc i2'Ignore'   ; 7 undefined
                dc i2'Ignore'   ; 8 Activate
                dc i2'Ignore'   ; 9 Switch
                dc i2'Ignore'   ; 10 Desk accessory
                dc i2'Ignore'   ; 11 Device driver
                dc i2'Ignore'   ; 12 ap
                dc i2'Ignore'   ; 13 ap
                dc i2'Ignore'   ; 14 ap
                dc i2'Ignore'   ; 15 ap
                dc i2'Ignore'   ; TASK 0 indesk
                dc i2'MenuSelect'               ; TASK 1 in menuBar
                dc i2'Ignore'   ; TASK 2 in system window
                dc i2'InContent'                ; TASK 3 in content
                dc i2'Ignore'   ; TASK 4 in Drag
                dc i2'Ignore'   ; TASK 5 in grow
                dc i2'Ignore'   ; TASK 6 in goaway
                dc i2'Ignore'   ; TASK 7 in zoom
                dc i2'Ignore'   ; TASK 8 in info bar
                dc i2'MenuSelect'               ; TASK 9 in special             menu
                dc i2'Ignore'   ; TASK 10 in NDA
                dc i2'Ignore'   ; TASK 11 in frame
                dc i2'Ignore'   ; TASK 12 in drop

                end

                EJECT
*******************************************************************************
*
MenuSelect      start
*
* Description:  This routine is called when TaskMaster returns a menu
*               event. It takes the menu item that was hit and calculates
*               an offset into the menu dispatch table. It then calls that
*               routine and unhilites the menu when it is done. 
*
* Inputs:       TaskData holds menu item selected.
*
* Outputs:      NONE
*
* External Refs:
*               Import ignore
*               Import doAbout
*               Import doQuit
*
* Entry Points: NONE
*
*******************************************************************************
                using Globals

                lda TaskData    ; Get the ID of the menu item selected.
                sec             ; Turn it into an index by subtracting
                sbc #FirstMenuID ; the starting ID number (250) and mul-
                asl a           ; tiplying by 2 (each table entry con-
                tax             ; sists of 2 bytes).
                jsr (menuTable,x) ; Call the routine behind it.

                PushWord #0     ; Routine done - unhilite the menubar.
                PushWord taskData+2
                _HiLiteMenu

                rts

MenuTable       dc i2'Ignore'   ; undo
                dc i2'Ignore'   ; cut
                dc i2'Ignore'   ; copy
                dc i2'Ignore'   ; paste
                dc i2'Ignore'   ; clear
                dc i2'Ignore'   ; close
                dc i2'doAbout'
                dc i2'doQuit'
                end

                EJECT
*******************************************************************************
*
Ignore          start
*
* Description:  Called when I want to ignore an event.
*
*
* Inputs:       NONE
*
* Outputs:      NONE
*
* External Refs:                NONE
*
* Entry Points: NONE
*
*******************************************************************************

                rts
                end


                
*******************************************************************************
*
doUpdate        start
*
* Description:  Called by the Main Event Loop to update a window's
*               contents. This routine is only called if you are not
*               telling TaskMaster to perform updates.
*
*
* Inputs:       NONE
*
* Outputs:      NONE
*
* External Refs:                NONE
*
* Entry Points: NONE
*
*******************************************************************************
                using Globals

                rts
                end


                EJECT
*******************************************************************************
*
testTopWindow   start
*
* Description:  This routine is called on every NULL event. It checks the
*               type of the top window, if it has changed from App window
*               to system window or back, this routine will call DoSysChange
*
*
* Inputs:       None
*
* Outputs:      None
*
* External Refs:
*               Import doSysChange
*
* Entry Points:
*
*******************************************************************************
                using Globals
                
                PushLong #0     ; first get a pointer to the frontmost
                _FrontWindow    ; window
                PullLong Deref  ; store it in deref temporarily
                
                lda Deref       ; first test for a NIL pointer. If its
                ora Deref+2     ; NIL then we do not have to do the 
                beq TTW0010     ; getWKind call
                
                PushWord #0     ; if not a NIL pointer then get the
                PushLong Deref  ; Kind of window
                _getWKind
                pla             
TTW0010         ANOP
                cmp windType    ; Now test the window kind to see if it
                beq TTW0020     ; has changed, if not then ignore it
                
                sta windType    ; if the window kind has changed, then
                jsr doSysChange ; save the new value and change menus
TTW0020         ANOP
                rts
                end
                
                EJECT
*******************************************************************************
*
doSysChange     start
*
* Description:  Called by the Main Event Loop when the upper most window
*               has changed to or from a system window.
*
*
* Inputs:       <A> Bit 15 set if the top window is a system window
*
* Outputs:      NONE
*
* External Refs:                NONE
*
* Entry Points: NONE
*
*******************************************************************************
                using Globals

                cmp #0
                beq SysDeact    ; if high bit not set then App Window

; This routine enables the edit menu when a system window becomes active        
SysActivate     ANOP
                PushWord #UndoID ;its an activate event so go thru and
                _EnableMItem    ; enable all the edit items and the
                
                PushWord #CutID ; close item
                _EnableMItem
                
                PushWord #CopyID
                _EnableMItem
                
                PushWord #PasteID
                _EnableMItem
                
                PushWord #ClearID
                _EnableMItem
                
                PushWord #CloseID
                _EnableMItem
                rts

; This routine disables the edit menu when a system window is cover up          
SysDeact        ANOP
                PushWord #UndoID ;its an deactivate event so go thru 
                _DisableMItem   ; and disable all the edit items and 
                
                PushWord #CutID ; the close item
                _DisableMItem
                
                PushWord #CopyID
                _DisableMItem
                
                PushWord #PasteID
                _DisableMItem
                
                PushWord #ClearID
                _DisableMItem
                
                PushWord #CloseID
                _DisableMItem
                
                rts
                end

                EJECT
*******************************************************************************
*
InContent       start
*
* Description:  Called to handle clicks in a window's contents.
*
*
* Inputs:       NONE
*
* Outputs:      NONE
*
* External Refs:                NONE
*
* Entry Points: NONE
*
*******************************************************************************
                using Globals

                rts
                end

                EJECT
*******************************************************************************
*
doQuit          start
*
* Description:  Quit routine. Set the QuitFlag to TRUE for the EventLoop.
*               This is how we signal that the user wants to quit the
*               application.
*
*
* Inputs:       NONE
*
* Outputs:      QuitFlag set to $FFFF
*
* External Refs:                NONE
*
* Entry Points: NONE
*
*******************************************************************************
                using Globals

                lda #$FFFF      ; load any non-zero value
                sta QuitFlag    ; and save it in the quitflag
                rts
                end


                EJECT
*******************************************************************************
*
doAbout         start
*
* Description:  Bring up an Alert Dialog box with our name in it.
*
* Inputs:       NONE
*
* Outputs:      NONE
*
* External Refs:                NONE
*
* Entry Points: NONE
*
*******************************************************************************
                using Globals

                pha             ; space for result
                PushLong #AbtBox640             ; pointer to alert template
                PushLong #0     ; pointer to a filter proc (0=none)
                _NoteAlert
                pla             ; get the item hit and dispose

                rts

; About Box alert template
; This is the 640 mode about box template. See the menus example program
; for an example of the same box in 320 mode.

AbtBox640       dc i2'30,30,100,590'  ; Bounding rectangle for the alert
                dc i2'1'        ; this is alert # 1
                dc i1'AlertDrawn+0' ; flags for stage 1 (visible no beep)
                dc i1'AlertDrawn+1' ; flags for stage 2 (visible 1 beep)
                dc i1'AlertDrawn+2' ; flags for stage 3 (visible 2 beep)
                dc i1'AlertDrawn+3' ; flags for stage 4 (visible 3 beep)
                dc i4'OkButton' ; ok button for the alert
                dc i4'AboutTitle' ; title of the program
                dc i4'AboutAut' ; author
                dc i4'AboutVers'  ; version number string
                dc i4'0'        ; nil to end the list

OKBTitle        str 'OK'
OKButton        dc i2'1'
                dc i2'50,500,65,550'
                dc i2'ButtonItem'
                dc i4'OKBTitle'
                dc i2'0'
                dc i2'0'        ; item flag
                dc i4'0'        ; no color table

AboutTitle      dc i2'2'
                dc i2'10,100,20,550'
                dc i2'StatText+ItemDisable'
                dc i4'TitleString'
                dc i2'0'
                dc i2'0'        ; item flag
                dc i4'0'        ; no color table

AboutAut        dc i2'3'
                dc i2'25,100,35,550'
                dc i2'StatText+ItemDisable'
                dc i4'AutString'
                dc i2'0'
                dc i2'0'        ; item flag
                dc i4'0'        ; no color table

AboutVers       dc i2'4'
                dc i2'40,100,50,550'
                dc i2'StatText+ItemDisable'
                dc i4'VersString'
                dc i2'0'
                dc i2'0'        ; item flag
                dc i4'0'        ; no color table

                end


                END
